package com.example.demo.mapper;

import com.example.demo.entity.pojo.Card;
import com.example.demo.entity.pojo.LevelType;
import com.example.demo.entity.pojo.Student;
import com.example.demo.entity.vo.StudentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface StudentMapper {
    //登录
    Student login(@Param("account") String account);

    //获取个人信息
    Student getMessage(@Param("id") int id);

    //获取可借书籍类型与数量集合
    List<LevelType> getType(@Param("cardId") int cardId);

    //获取卡的信息
    Card getCardMessage(@Param("id") int id);

    //充值
    int recharge(@Param("money") double money,@Param("id") int id);

    //消费
    int consumption(@Param("money") double money,@Param("id") int id);

    //改变可以借次数
    int changeCardCount(@Param("num") int num,@Param("cardId") int cardId);

    //修改密码
    int modifyPassword(int id, String newPassword, String oldPassword);

    //注册
    int register(@Param("account") String account, @Param("password") String password,@Param("sex") String sex,@Param("age") String age, @Param("name") String name, @Param("graderNumber") String graderNumber);

    //根据账号查询
    Student getMessageByAccount(String account,String gardeNumber);


    //添加卡的id
    int addCardId(int id, int cardId);
}
